{include file="index/header" /}
<div class="container xs-top-15" style="max-width:960px">
    <div class="columns">
        <!--区域1-->
        <div class="column is-two-thirds">
            <!--搜索模块-->
            {include file="index/search_module" /}
            <hr class="xs-hr">
            <!--模块2-->
            <div class="card">
                <div class="tabs" style="margin-bottom:0px;">
                    <ul>
                        <li class="is-active">
                            <a>
                                <span class="icon">
                                    <i class="fa fa-question"></i>
                                </span>
                                问题详情
                            </a>
                        </li>
                    </ul>
                </div>
                <div class="xs-card-content-15">
                    <div class="content">
                        <div>
                            <h5>{$question_info.title}</h5>
                            <hr class="xs-hr">
                            <div style="font-size: 15px;">
                                {$question_info.option|raw}
                            </div>
                            <hr class="xs-hr">
                            <div class="is-clearfix" style="font-size: 12px;color: #a0a0a0;">
                                <span class="is-pulled-left">所属分类：
                                    {eq name="question_info.profile.fid" value="0"}
                                    <a
                                        href="{:url('index/index/cate',['type'=>$question_info.profile.alias])}">{$question_info.profile.name}</a>
                                        {eq name="question_info.profile.type" value="1"}<span style="color: #b37d19;">(免费栏目)</span>{/eq}
                                    {else/}
                                    {notempty name="sort_a"}
                                    <a
                                        href="{:url('index/index/cate',['type'=>$sort_a.alias,'c'=>$question_info.profile.alias])}">{$question_info.profile.name}</a>
                                        {eq name="$question_info.profile.type" value="1"}<span style="color: #b37d19;">(免费栏目)</span>{/eq}
                                    {/notempty}

                                    {/eq}
                                </span>
                                <span class="is-pulled-right">所需题豆：&nbsp;<span
                                        style="color: #fb1140">{$question_info.price}</span>&nbsp;个</span>
                                <span class="is-pulled-right" style="margin-right: 10px;"> 浏览量：&nbsp;<span
                                        style="color: #252525">{$question_info.look}</span>&nbsp;次</span>
                            </div>
                            <hr class="xs-hr">
                            <div id="ans" class="" style="color: #ea1f48;display: none;">
                                答案：<span id="answer"> </span>
                                <hr class="xs-hr">
                            </div>

                            <div style="margin-left: 20%;margin-right: 20%;">
                                <button class="button is-link is-fullwidth" onclick="show()">查看正确答案</button>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
            {eq name="$adver[3]['state']" value="1"}
            <div class="card">
                <div class="xs-card-content">
                    <div class="content">
                        <a href="{$adver[3]['url']}" target="_blank"><img src="{$adver[3]['img_url']}" alt=""></a>
                    </div>
                </div>
            </div>
            {/eq}

        </div>
        <!--区域2-->
        <div class="column">
            <!--模块1-->
            <div class="card">
                <header class="card-header">
                    <p class="card-header-title">
                        <span class="icon has-text-danger">
                            <i class="fa fa-fire"></i>
                        </span>
                        栏目最热
                    </p>
                    <a class="card-header-icon" aria-label="more options">
                        <span class="icon">
                            <i class="fas fa-angle-down" aria-hidden="true"></i>
                        </span>
                    </a>
                </header>
                <div class="xs-card-content">
                    <div class="content">
                        <div class="right_remen-list">
                            <ul style="margin-left:5px;margin-top:0px;">
                                {volist name='hot_list' id='q'}
                                <li style="border-bottom:1px dashed #c1cad4;padding-bottom: 10px;"><a
                                        href="{:url('index/index/ask',['id'=>$q.Id])}" target="_blank"
                                        class="xs-right_c">{$q.title}</a></li>
                                {/volist}
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
            <hr class="xs-hr">
            <!--模块1-->
            <div class="card">
                <header class="card-header">
                    <p class="card-header-title">
                        随机推荐
                    </p>
                    <a class="card-header-icon" aria-label="more options">
                        <span class="icon">
                            <i class="fas fa-angle-down" aria-hidden="true"></i>
                        </span>
                    </a>
                </header>
                <div class="xs-card-content">
                    <div class="content">
                        <div class="right_remen-list">
                            <ul style="margin-left:5px;margin-top:0px;">
                                {volist name='rand_list' id='q'}
                                <li style="border-bottom:1px dashed #c1cad4;padding-bottom: 10px;"><a
                                        href="{:url('index/index/ask',['id'=>$q.Id])}" target="_blank"
                                        class="xs-right_c">{$q.title}</a></li>
                                {/volist}
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>

    function show() {
        var data = {
            'id': {$question_info.Id}
        };
        $.ajax({
            type: "POST",
            url: "{:url('api/api/ask')}",
            data: data,
            dataType: "json",
            success: function (data) {
                if(data.code == -2){
                    layer.confirm(data.msg, {
                        btn: ['去登陆','去注册','关闭']
                    }, function(index){
                        window.open("{:url('index/index/login')}");
                        layer.close(index);
                    }, function(index){
                        window.open("{:url('index/index/reg')}");
                        layer.close(index);
                    },function (index) {
                        layer.close(index);
                    });
                }else if(data.code == -1){
                    layer.alert('请正确访问！');
                }else if(data.code == 2){
                    layer.confirm(data.msg, {
                        btn: ['去充值']
                    }, function(index){
                        window.open("{:url('index/user/pay')}");
                        layer.close(index);
                    });
                }else if(data.code == 1){
                    $("#ans").css("display", "block");
                    $("#answer").text(data.answer);
                }

            },
            error: function (data) {

                layer.alert('请求失败！',{skin: 'layui-layer-lan'});
            }
        });
    }
</script>
{include file="index/footer" /}